#include "fxcc/imgui/FileSystemTreeNodeEditor.h"

void fxcc::imgui::FileSystemTreeNodeEditor::ViewFunc()
{
	TreeEditDir(*m_RootDir);

}

void fxcc::imgui::FileSystemTreeNodeEditor::HandleFunc()
{
}

void fxcc::imgui::FileSystemTreeNodeEditor::TreeEditDir(fxcc::Dir& dir)
{
	int index = 0;
	if (m_Editor.TreeNode(dir.m_FileName, dir.m_ImguiFlag, index++))
	{
		for (auto childDir : dir.m_Dirs)
		{
			TreeEditDir(*childDir);
		}

		for (auto file : dir.m_Files)
		{
			ImGui::Text("%s", file->m_FileName.c_str());
		}
		m_Editor.TreePop();
	}
}
